/**
 * URL路由的主入口.
 */

import Vue from 'vue'
import Router from 'vue-router'

const ALogin  = () => import('@/pages/ALogin.vue')
const TiyIndex = () => import('@/pages/TiyIndex.vue')
const AError = () => import('@/pages/AError.vue')
const AImage = () => import('@/pages/image/ImageManager.vue')



//拆分出去的 router
import QxRouters from './QXRouter.js'
import UserRouters from './UserRouter.js'
import ProductRouters from "./ProductRouter.js"
import OrderRouters from "./OrderRouter.js"
import  NewOrderRouters from './NewOrderRouter'
import OtherRouters from "./OtherRouter.js"
import UtilRouters from "./UtilRouter.js"
import AnalysisRouters from './AnalysisRouter.js'
import ACouponRouters from './CouponRouter.js'
import WorkRouters from './WorkRouter'
import ChatRouters from './ChatRouter'
import StandRouters from "./StandsRouter";
import EmailRouters from "./EmailRouter";
import ProductSourceRouters from "./ProductSourceRouter";
import ImpProductRouter from "./ImpProductRouter";
import BlogRouters from "./BlogRouter.js"
import SEORouters from "./SEORouter.js"

Vue.use(Router);


let routers = [];

routers = routers.concat(QxRouters);
routers = routers.concat(UserRouters);
routers = routers.concat(ProductRouters);
routers = routers.concat(OrderRouters);
routers = routers.concat(NewOrderRouters);
routers = routers.concat(OtherRouters);
routers = routers.concat(UtilRouters);
routers = routers.concat(AnalysisRouters);
routers = routers.concat(ACouponRouters);
routers = routers.concat(WorkRouters);
routers = routers.concat(ChatRouters);
routers = routers.concat(StandRouters);
routers = routers.concat(EmailRouters);
routers = routers.concat(ProductSourceRouters);
routers = routers.concat(ImpProductRouter);
routers = routers.concat(BlogRouters);
routers = routers.concat(SEORouters);

routers.push(
  {
    path:'/image',
    name: "AImage",
    component:AImage
  },
);

routers.push(
  {
    path:'/error',
    name: "error",
    component:AError
  },
);

// 默认的一些不属于各大模块的路由
let routersRoot = [
  {
    path:'/login',
    name: "ALogin",
    component:ALogin
  },
  {
    path:'/',
    name: "TiyIndex",
    component:TiyIndex,
    children:routers
  },

  {
    path: '/',
    name: 'ALogin',
    component: ALogin
  }
];


export default new Router({
  routes:routersRoot
})
